import java.io.*;

public class InputStreamReaderDemo {
    public static void main(String[] args) {
        try(
                InputStream is = new FileInputStream("file-io\\src\\gbk.txt");

                //字符转换流是Reader和Writer的子类,是实现从字节流中读取文件并用指定的编码方式转换成字符流
                Reader r = new InputStreamReader(is,"GBK");
                BufferedReader br = new BufferedReader(r);
                ) {
            String line;
            while((line = br.readLine())!=null){
                System.out.println(line);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
